<?php

/**
 * 配置
 */

namespace wtfphp\libs;

class config {
    private static $_config = array();

    /**
     * 设置
     * set(array);
     * set($name, $value);
     */
    function set($name, $value = null) {
        if (is_array($name)) {
            self::$_config = array_merge(self::$_config, $name);
        } else {
            self::$_config[$name] = $value;
        }
    }

    /**
     * 获取
     * get();
     * get($name);
     */
    function get($name = null) {
        if (is_null($name)) {
            return self::$_config;
        } else {
            return self::$_config[$name];
        }
    }
}